{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "438fa9a4",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\python310\\lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ID对应的字符： ç®Ģ\n"
     ]
    }
   ],
   "source": [
    "from transformers import AutoTokenizer\n",
    "\n",
    "tokenizer = AutoTokenizer.from_pretrained(r\"D:\\models\\qwen3-0.6b\", use_fast=False, trust_remote_code=True)\n",
    "\n",
    "# 假设ç®Ģ对应的ID是xxx（替换为实际ID）\n",
    "unknown_id = 98237\n",
    "# 将ID转回字符\n",
    "char = tokenizer.convert_ids_to_tokens(unknown_id)\n",
    "print(\"ID对应的字符：\", char)  # 输出应为\"ç®Ģ\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e4ac28e1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
